1. Field of the Invention
The present general inventive concept relates to a method of compensating tilt using a two-axis geomagnetic sensor and acceleration sensor and an apparatus thereof, and particularly, to a method of compensating tilt using a two-axis geomagnetic sensor and acceleration sensor, which compensate an azimuth changed by tilt to perform tilt compensation so that a constant azimuth can be always output, and an apparatus thereof.
2. Description of the Related Art
In general, a geomagnetic sensor, which measures the intensity of terrestrial magnetism (or geomagnetic field) to detect an azimuth angle, can be applied as an electronic compass of which the output is changed for the better in a digital manner in comparison with a compass using a general magnetic needle.
With only a two-axis geomagnetic sensor for measuring the terrestrial magnetism, the terrestrial magnetism can be measured to output an azimuth angle. However, this is possible only when the geomagnetic sensor is horizontal to the earth surface. When the geomagnetic sensor is tilted with respect to the horizontal direction of the earth surface, errors occur on measuring the azimuth angle. The errors increase according to a tilted angle of the geomagnetic sensor.
Here, the reason why the azimuth errors occur when the geomagnetic sensor is tilted is that the terrestrial magnetism is not horizontal to the earth surface but is formed to be at a constant angle. According to the measurement result, it can be found that an angle of the terrestrial magnetism with the earth surface differs according to the latitude of the earth. In general, the angle with the earth surface is horizontal to the earth surface around the terrestrial equator, but the angle with the earth surface increases as the latitude approaches the North Pole or the South Pole. The angle becomes substantially perpendicular around the poles.
In order to compensate azimuth errors caused by the tilt of the geomagnetic sensor, a three-axis geomagnetic sensor and two-axis acceleration sensor are needed. The three-axis geomagnetic sensor serves to accurately measure the intensity and direction of terrestrial magnetism existing in a three-dimensional space, and the acceleration sensor serves to measure how much each axis of the geomagnetic sensor is tilted so as to measure a tilt angle for the tilt compensation. The acceleration sensor, which measures the earth's gravity, can measure a change in the earth's gravity to be measured in each axis to measure how much the geomagnetic sensor is titled.
As described above, the three-axis geomagnetic sensor is required to compensate tilt of the geomagnetic sensor. In this case, however, there are drawbacks in that it is difficult to manufacture the three-axis geomagnetic sensor because of the physical characteristics of the sensor and it is also difficult to commonly use the sensor because the compensation for each axis of the sensor is complicated after the sensor is manufactured. Therefore, studies of a tilt compensating method using the two-axis geomagnetic sensor recently come into the spotlight.
FIG. 1 is a diagram illustrating a general horizontal geomagnetic field and tilted geomagnetic field.
In FIG. 1, Xh, Yh, and Zh indicate values of horizontal geomagnetic field measured in the X, Y, and Z axis when the geomagnetic sensor is horizontal to a horizontal plane of the earth surface, and Xt, Yt, and Zt indicate geomagnetic field values measured in a state where the geomagnetic sensor is tilted at a predetermined angle with a horizontal plane of the earth surface. Further, θ and φ are tilt angles obtained by the output of the acceleration sensor, θ representing a tilted angle of the X axis of the horizontal geomagnetic field and φ representing a tilted angle of the Y axis of the horizontal geomagnetic field.
Then, a method of compensating tilt using a two-axis geomagnetic sensor according to the related art will be described.
First, in order to measure an azimuth angle (ψ) by using the two-axis geomagnetic sensor, the two-axis geomagnetic sensor is placed horizontally to the earth surface to measure the geomagnetic field values (Xh)(Yh) of the X and Y axes. At this time, when the terrestrial magnetism is represented by H, the terrestrial magnetism (H) in the horizontal geomagnetic field is as follows.H=Xh+Yh+Zh   [Equation 1]
When the arctan value of two signals (Xh)(Yh) measured in the X and Y axes is calculated, a desired azimuth angle (ψ) can be calculated. Therefore, the azimuth angle (ψ) can be evaluated from Equation 1 as follows.
                    ψ        =                              tan                          -              1                                ⁡                      (                                          Y                h                                            X                h                                      )                                              [                  Equation          ⁢                                          ⁢          2                ]            
In this case, if the two-axis geomagnetic sensor is tilted, a complicated equation for the tilt compensation is necessary, and the compensation equation is as follows.
                              [                                                                      X                  h                                                                                                      Y                  h                                                                                                      Z                  h                                                              ]                =                              C            t            h                    ⁡                      [                                                                                X                    t                                                                                                                    Y                    t                                                                                                                    Z                    t                                                                        ]                                              [                  Equation          ⁢                                          ⁢          3                ]            
Here, Xt, Yt, and Zt indicate geomagnetic field values measured in a state where the two-axis magnetic sensor is tilted with the earth surface, Cth is a vector value which transforms the output of tilted two-axis geomagnetic sensor into the output in a state where the sensor is horizontal to the earth surface, and Xh, Yh, and Zh indicate geomagnetic field values measured in three axes when the two-axis geomagnetic sensor is horizontal to a horizontal plane of the earth surface.
At this time, the vector value (Cth) to be used is as follows.
                              C          t          h                =                  [                                                                      cos                  ⁢                                                                          ⁢                  θ                                                                              sin                  ⁢                                                                          ⁢                  θsin                  ⁢                                                                          ⁢                  ϕ                                                                              sin                  ⁢                                                                          ⁢                  θcos                  ⁢                                                                          ⁢                  ϕ                                                                                    0                                                              cos                  ⁢                                                                          ⁢                  ϕ                                                                                                  -                    sin                                    ⁢                                                                          ⁢                  ϕ                                                                                                                          -                    sin                                    ⁢                                                                          ⁢                  θ                                                                              cos                  ⁢                                                                          ⁢                  θsin                  ⁢                                                                          ⁢                  ϕ                                                                              cos                  ⁢                                                                          ⁢                  θcos                  ⁢                                                                          ⁢                  ϕ                                                              ]                                    [                  Equation          ⁢                                          ⁢          4                ]            
At this time, if Equation 4 is substituted to Equation 3 to solve for Xh, Yh, and Zh, the resultant equations is as follows.Xh=Xt cos θ+Yt sin θ sin φ+Zt sin θ cos φ  [Equation 5]Yh=Yt cos φ−t sin φ  [Equation 6]Zh=−Xt sin θ+Yt cos θ sin φ+Zt cos θ cos φ  [Equation 7]
Here, θ and φ indicate tilt angles to be obtained by the output of the acceleration sensor, θ representing a tilted angle of the X axis of the horizontal magnetic field and φ representing a titled angle of the Y axis of the horizontal magnetic field.
The azimuth angle (ψ) in a state where the two-axis geomagnetic sensor is tilted with respect to a horizontal plane of the earth surface is evaluated by substituting Equations 5 and 6 to Equation 1. The equation thereof is as follows.
                                                        ψ              =                            ⁢                                                tan                                      -                    1                                                  ⁡                                  (                                                            Y                      h                                                              X                      h                                                        )                                                                                                        =                            ⁢                                                tan                                      -                    1                                                  ⁡                                  (                                                                                                              Y                          t                                                ⁢                        cos                        ⁢                                                                                                  ⁢                        ϕ                                            -                                                                        Z                          t                                                ⁢                        sin                        ⁢                                                                                                  ⁢                        ϕ                                                                                                                                      X                          t                                                ⁢                        cos                        ⁢                                                                                                  ⁢                        θ                                            +                                                                        Y                          t                                                ⁢                        sin                        ⁢                                                                                                  ⁢                        θsin                        ⁢                                                                                                  ⁢                        ϕ                                            +                                                                        Z                          t                                                ⁢                        sin                        ⁢                                                                                                  ⁢                        θcosϕ                                                                              )                                                                                        [                  Equation          ⁢                                          ⁢          8                ]            
On the other hand, when tilt is compensated by using the three-axis geomagnetic sensor, another equation is not needed in addition to the above-described equations, because Xt, Yt, and Zt are all measured. However, when the two-axis geomagnetic sensor is used, Zt should be calculated separately because the Z-axis geomagnetic field value (Zt) cannot be measured.
The solution for Zt in Equation 7 is as follows.
                              Z          t                =                                            Z              h                        +                                          X                t                            ⁢              sin              ⁢                                                          ⁢              θ                        -                                          Y                t                            ⁢              cos              ⁢                                                          ⁢              θsin              ⁢                                                          ⁢              ϕ                                            cos            ⁢                                                  ⁢            θcosϕ                                              [                  Equation          ⁢                                          ⁢          9                ]            
Here, in order to calculate Zt, Zh (sin λ) needs to be known. Further, in order to calculate Zh, an angle (a dip angle (λ)) of terrestrial magnetism with a horizontal plane of the earth surface needs to be known. The dip angle (λ), which is an angle between a vertical component of terrestrial magnetism and a horizontal plane of the earth surface, increases in the Northern Hemisphere and decreases in the Southern Hemisphere as the latitude becomes higher.
FIG. 2 is a diagram illustrating a dip angle between a general horizontal geomagnetic field and the geomagnetic field.
In FIG. 2, when the two-axis geomagnetic sensor is horizontal to the earth surface, Xh, Yh, and Zh represent the values of the horizontal geomagnetic field measured in the X, Y, and Z axes, Xd, Yd, and Zd represent geomagnetic field values, and Nm represents magnetic north. Here, an angle between the geomagnetic field (Xd, Yd, and Zd) and the horizontal geomagnetic field (Xh, Yh, and Zh) is a dip angle (λ).
In a state where the two-axis geomagnetic sensor is tilted with respect to the earth surface, the signal intensities (Xd, Yd, and Zd) measured in the X, Y, and Z axes are evaluated as follows.
                              [                                                                      X                  d                                                                                                      Y                  d                                                                                                      Z                  d                                                              ]                =                              [                                                                                cos                    ⁢                                                                                  ⁢                    λ                                                                    0                                                                      sin                    ⁢                                                                                  ⁢                    λ                                                                                                0                                                  0                                                  0                                                                                                                        -                      sin                                        ⁢                                                                                  ⁢                    λ                                                                    0                                                                      cos                    ⁢                                                                                  ⁢                    λ                                                                        ]                    ⁡                      [                                                                                X                    h                                                                                                                    Y                    h                                                                                                                    Z                    h                                                                        ]                                              [                  Equation          ⁢                                          ⁢          10                ]            
If the X-axis, Y-axis, and Z-axis values (Xd, Yd, and Zd) of geomagnetic field measured by the two-axis geomagnetic sensor is (1, 0, 0) as in Equation 11 to be described below and the intensity of terrestrial magnetism is 1, Zh can be evaluated in Equation 12 as follows.
                              [                                                                      X                  d                                                                                                      Y                  d                                                                                                      Z                  d                                                              ]                =                  [                                                    1                                                                    0                                                                    0                                              ]                                    [                  Equation          ⁢                                          ⁢          11                ]            Zh=sin λ  [Equation 12]
Here, Zh is a value of the horizontal coordinate system measured in the Z axis when the two-axis geomagnetic sensor is horizontal to a horizontal surface of the earth surface.
In the end, in order to compensate tilt of the two-axis geomagnetic sensor, the value of Zh can be evaluated in Equation 12 in case where the dip angle (λ) is known, without measuring the value of Zh. Further, the value of Zh can be substituted to Equation 9 to evaluate Zt. Therefore, since the three-axis values of Xt, Yt, and Zt can be all obtained by using the two-axis geomagnetic sensor, an error ratio of dip angle at each azimuth angle can be compensated.
Then, a method of measuring a dip angle using the two-axis geomagnetic sensor according to the related art will be described.
FIG. 3 is a flow chart illustrating the method of measuring a dip angle using the two-axis geomagnetic sensor according to the related art.
First, after the two-axis geomagnetic sensor is maintained to be horizontal to a horizontal plane of the earth surface (Step S11), an arbitrary azimuth angle to be output from the two-axis geomagnetic sensor is set to a reference azimuth angle (ψa) (Step S12).
Then, the two-axis geomagnetic sensor is maintained to be tilted at a predetermined angle with the reference azimuth angle (ψa) (Step S13).
Then, an azimuth (ψb), which is changed after the two-axis geomagnetic sensor is tilted, is measured by the following method (Step S30).
First, while the dip angle (λ) is changed one degree at a time from −90° to 90° in Equation 10, an azimuth angle (ψb) with respect to each dip angle (λ) is calculated to be stored (Steps S14 to S 18).
A method of calculating an azimuth angle (ψb) by using the dip angle (λ) is as follows.
First, the dip angle (λ) which is changed one degree at a time from −90° to 90° is substituted to Equation 12, so that the geomagnetic field value (Zh) is calculated, which is measured in the Z axis when the two-axis geomagnetic sensor is horizontal to a horizontal surface of the earth surface. Further, the value of Zh is substituted to Equation 9 to calculate Zt (the Z-axis geomagnetic field value measured in a state where the two-axis geomagnetic sensor is tilted with respect to a horizontal plane of the earth surface), and the value of Zt is then substituted to Equation 8 to calculate the changed azimuth angle (ψb).
On the other hand, the range of the azimuth angle (ψb) with respect to the dip angle (λ) which is changed one degree at a time from −90° to 90° is from 1° to 180°. Further, the range of the dip angle (λcan be set to ±90° as described above, and can be calculated while the dip angle is changed by a certain range (for example, one degree at a time) within a predetermined range of the dip angle (λ).
Next, the reference azimuth angle (ψa) and the measured and calculated azimuth angle (ψb) are compared with each other to find out an azimuth of which the declination with respect to the reference azimuth angle (ψa) is the minimum (Step S19).
Next, the dip angle (λ) applied to the found azimuth angle is set to a dip angle (λ) at the corresponding azimuth angle to be stored (Steps S20 to S21).
As described above, the method of compensating tilt using the two-axis geomagnetic sensor according to the related art is a method where a dip angle (λ) between the terrestrial magnetism and the earth surface is measured to compensate the tilt of the two-axis geomagnetic sensor, but it is difficult to compensate tilt because the process of measuring the dip angle (λ) is complicated and difficult as described above.
In the related art, the reference azimuth (ψa) angle should be set in a state where the two-axis geomagnetic sensor is maintained to be horizontal. In this case, since large azimuth errors occur when the reference azimuth angle (ψa) is set to any one of values around some azimuth angles (for example, 0°, 90°, 180°, and 270°), the reference azimuth (ψa) must be limited to only a specific range.
In the related art, when the two-axis geomagnetic sensor is used to compensate tilt, the position thereof should be changed only in the vertical direction (PITCH). In practice, however, the two-axis geomagnetic sensor also rotates in the left and right direction (YAW) as well as in the vertical direction (PITCH). Therefore, the tilt compensation for azimuth errors is not performed properly.
In the related art, a user must perform a series of steps from a step where the two-axis geomagnetic sensor is maintained to be horizontal to a horizontal plane of the earth surface to set a reference azimuth angle (ψa) to a step where the user must stop an operation for a certain time after the two-axis geomagnetic sensor is tilted at a predetermined angle with the reference azimuth angle (ψa) until a dip angle (λ) with respect to the changed azimuth angle (ψb) is input, which is annoying and inconvenient.